<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\User;
use App\Model\Role;
use App\Http\Resources\UserResource;
use App\Http\Resources\UserCollection;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use App\Http\Requests\UserRequest;

class ProfileController extends Controller
{

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function user(Request $request)
    {
		$data['code']=0;
		$data['data']=$request->user('api');
		$data['error']="";
		$data['message']="success";
		$data['timestamp']=time();
		return $data;
    }
	
    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function menu(Request $request)
    {
		$data['code']=0;
		$data['data']=$request->user('api')->menus();
		$data['error']="";
		$data['message']="success";
		$data['timestamp']=time();
		return $data;
    }
    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function message(Request $request)
    {
		$data['code']=0;
		$data['data']=$request->user('api')->user->menu();
		$data['error']="";
		$data['message']="success";
		$data['timestamp']=time();
		return $data;
    }
    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function message_count(Request $request)
    {
		$data['code']=0;
		$data['data']=10;
		$data['error']="";
		$data['message']="success";
		$data['timestamp']=time();
		return $data;
    }
}
